'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 7_llm_chat_model_with_batch.py
* @Time: 2025/10/22
* @All Rights Reserve By Brtc
'''
from datetime import datetime

import dotenv
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
dotenv.load_dotenv()
#1、编排 prompt
prompt = ChatPromptTemplate.from_messages([
    ("system", "你是OpenAI 研发的机器人, 请回答用户的问题， 现在时间是 {now}"),
    ("human","{query}")
]).partial(now = datetime.now)

#2、创建大模型
llm = ChatOpenAI(model = "gpt-4o-mini")
ai_message = llm.batch([
    prompt.invoke({"query":"你好你是？"}),
    prompt.invoke({"query", "请讲一个程序员的冷笑话"})
])

for one_message in ai_message:
    print("=====================================")
    print(one_message.content)